﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.SamllPicPrint.Presenter;
using MINERP.BLL.SmallPic;
using MINERP.MODEL.FoundationModel;

namespace MINERP.SamllPicPrint.Forms
{
    public partial class FrmSelSavePicDir : Form
    {
        SamllPicMainBLL _bll;
        PrintConfigBLL bll = new PrintConfigBLL();
        public int PrinterId{ get; set; }

        public FrmSelSavePicDir()
        {
            InitializeComponent();
            _bll = new SamllPicMainBLL();
        }

       

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmSelSavePicDir_Load(object sender, EventArgs e)
        {
            chkIsAutoPrintTicket.Checked = bll.GetPrinterConfigInfo(PrinterId).IsAutoPrintTikect;
           // checkEditAutoRocover.Checked = Properties.Settings.Default.AutoRecoverPath;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
           

            int ret = bll.UpdatePrinterConfig(PrinterId, chkIsAutoPrintTicket.Checked, 0);
            
            if (ret == 0)
            {
                MessageBox.Show("请重启界面应用配置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("连接数据库失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            
 
        }

        private void chkIsAutoPrintTicket_CheckedChanged(object sender, EventArgs e)
        {

        }

    }
}
